﻿using System.Windows;
using GalaSoft.MvvmLight.Threading;

namespace WpfChatClient
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        App()
        {
            DispatcherHelper.Initialize();
            this.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(App_DispatcherUnhandledException);
        }

        static void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            e.Handled = true;
            if (e.Exception != null)
            {
                MessageBox.Show(e.Exception.ToString());
            }
        }
    }
}
